package com.xiumiing.anr_demo;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.view.View;
import android.widget.Toast;

public class MainActivity extends AppCompatActivity {

    String mName ;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }

    public void onClick(View view) {
        switch (view.getId()){
            case R.id.button_ANR:
                try {
                    Thread.sleep(1000*100);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
                break;
            case R.id.button_Crash:
//                Toast.makeText(this,"空指针",Toast.LENGTH_LONG).show();
                boolean equals = mName.equals("");
                break;
            case R.id.button_Memory_leak:
                break;
            case R.id.button4:
                break;
            case R.id.button5:
                break;
        }
    }

}
